package com.googlecode.monitoria.client;

import org.junit.Before;

import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.googlecode.monitoria.client.services.MonitoriaService;
import com.googlecode.monitoria.client.services.MonitoriaServiceAsync;

public class GwtTestSample extends GWTTestCase {

	private MonitoriaServiceAsync server;
	
	@Before
	public void setup() {
		server = (MonitoriaServiceAsync) GWT.create(MonitoriaService.class);
	}

	public String getModuleName() {
		return "com.googlecode.monitoria.Application";
	}

	public void testFirstRun() {
		server.isFirstRun( new AsyncCallback<Boolean>() {
			public void onSuccess( Boolean result ) {
				if( !result ){
					fail();
				}
			}
			public void onFailure( Throwable arg0 ) {
				fail();
			}
		});
	}
}